package com.bawei.cashier

import androidx.lifecycle.MutableLiveData
import com.bawei.base.bean.PayerDetailEntity
import com.bawei.base.bean.PayerEntity
import com.bawei.base.mvvm.BaseViewModel
import com.bawei.base.net.ApiService
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class CashierViewModel @Inject constructor(var apiService: ApiService):BaseViewModel(){
    var payerSuccess=MutableLiveData<MutableList<PayerEntity>>()
    var payerDetailSuccess=MutableLiveData<PayerDetailEntity>()
    fun payerById(id:Int){
        httpRequest({apiService.payerById(id)},{payerSuccess.postValue(it)})
    }
    fun payerDetailById(id:Int){
        httpRequest({apiService.payerDetailById(id)},{payerDetailSuccess.postValue(it)})
    }
}